<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>vue4</title>
    <script src="../js/vue.js"></script>
</head>
<body>
<div id="app-1">
    <button v-on:click="counter +=1">增加1</button>
    <p>这个按钮被点击了{{counter}}次</p>
</div>
<div id="app-2">
    <button v-on:click="greet">Greet</button>
</div>
<script>
    var app2 = new Vue({
        el: '#app-2',
        data: {
            name: 'Vue.js'
        },
        methods: {
            greet: function (event) {
                alert('Hello' + this.name + '!')
                alert(event.target.tagName)
            }
        }
    })
    var app1 = new Vue({
        el: '#app-1',
        data: {
            counter: 0
        }
    })
</script>
</body>
</html>